package com.aaa.controller;



import com.aaa.entity.TbMember;
import com.aaa.service.MemberListService;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eig.common.vo.Result;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/membelist/member")
public class MemberListController {

  @Resource
  private MemberListService memberListService;


    @PostMapping("/getmemberAll/{current}/{pageSize}")
    public Result<IPage<TbMember>> getTeacherByPage(@PathVariable(required = true) Integer current,
                                                    @PathVariable(required =true ) Integer pageSize,
                                                      @RequestBody TbMember tbMember
    ){
        return memberListService.queryMemberList(current,pageSize,tbMember);
    }

  /**
   * 修改状态
   * @param isdisabled
   * @param id
   * @return
   */
  @PostMapping("/stateChange/{isdisabled}/{id}")
  @ApiImplicitParams({
          @ApiImplicitParam(name = "isdisabled",value = "用户状态"),
          @ApiImplicitParam(name = "id",value = "用户的id")
  })
 public Result<String> updateStatus(@PathVariable Boolean isdisabled,@PathVariable String id){

    return memberListService.updateStatus(isdisabled,id);
  }

    /**
     * 编辑信息
     */
    @PostMapping("/modifyStudentInformation")
    public Result modifyStudentInformation(@RequestBody TbMember tbMember){

        return memberListService.updateMember(tbMember);
    }
}
